﻿#region zh-CHS 2006 - 2007 DemoSoft 团队 | en 2006 - 2007 DemoSoft Team

//     NOTES
// ---------------
//
// This file is a part of the G.O.S.E(Game Online Server Engine) for .NET.
//
//                 2006-2007 DemoSoft Team
//
//
// First Version : by H.Q.Cai - mailto:caihuanqing@hotmail.com

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published
 *   by the Free Software Foundation; either version 2.1 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

#region zh-CHS 包含名字空间 | en Include namespace
using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
#endregion

namespace Demo_G.O.S.E.ServerEngine.Common
{
    #region zh-CHS 类 - 自定义属性 | en Class - Attribute
    /// <summary>
    /// 类并不支持在多线程中调用并处理
    /// </summary>
    [AttributeUsage( AttributeTargets.Class )]
    public class MultiThreadedNoSupportgAttribute : Attribute
    {
        #region zh-CHS 构造和初始化和清理 | en Constructors and Initializers and Dispose
        /// <summary>
        /// 类并不支持在多线程中调用并处理
        /// </summary>
        public MultiThreadedNoSupportgAttribute()
        {
        }

        /// <summary>
        /// 类并不支持在多线程中调用并处理
        /// </summary>
        public MultiThreadedNoSupportgAttribute( string strInfo )
        {
            m_strInfo = strInfo;
        }
        #endregion

        #region zh-CHS 共有属性 | en Public Properties
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 不支持多线程的详细信息
        /// </summary>
        private string m_strInfo;
        #endregion
        /// <summary>
        /// 不支持多线程的详细信息
        /// </summary>
        public string Info
        {
            get { return m_strInfo; }
            set { m_strInfo = value; }
        }
        #endregion
    }

    /// <summary>
    /// 类支持在多线程中调用并处理
    /// </summary>
    [AttributeUsage( AttributeTargets.Class )]
    public class MultiThreadedSupportgAttribute : Attribute
    {
        #region zh-CHS 构造和初始化和清理 | en Constructors and Initializers and Dispose
        /// <summary>
        /// 类支持在多线程中调用并处理
        /// </summary>
        public MultiThreadedSupportgAttribute()
        {
        }

        /// <summary>
        /// 类支持在多线程中调用并处理
        /// </summary>
        public MultiThreadedSupportgAttribute( string strInfo )
        {
            m_strInfo = strInfo;
        }
        #endregion

        #region zh-CHS 共有属性 | en Public Properties
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 支持多线程的详细信息
        /// </summary>
        private string m_strInfo;
        #endregion
        /// <summary>
        /// 支持多线程的详细信息
        /// </summary>
        public string Info
        {
            get { return m_strInfo; }
            set { m_strInfo = value; }
        }
        #endregion
    }

    /// <summary>
    /// 在多线程中调用并处理时需要注意，可能需要锁定再调用
    /// </summary>
    [AttributeUsage( AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Event )]
    public class MultiThreadedWarningAttribute : Attribute
    {
        #region zh-CHS 构造和初始化和清理 | en Constructors and Initializers and Dispose
        /// <summary>
        /// 在多线程中调用并处理时需要注意，可能需要锁定再调用
        /// </summary>
        public MultiThreadedWarningAttribute()
        {
        }

        /// <summary>
        /// 在多线程中调用并处理时需要注意，可能需要锁定再调用
        /// </summary>
        public MultiThreadedWarningAttribute( string strInfo )
        {
            m_strInfo = strInfo;
        }
        #endregion

        #region zh-CHS 共有属性 | en Public Properties
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 多线程的警告信息
        /// </summary>
        private string m_strInfo;
        #endregion
        /// <summary>
        /// 多线程的警告信息
        /// </summary>
        public string Info
        {
            get { return m_strInfo; }
            set { m_strInfo = value; }
        }
        #endregion
    }

    [AttributeUsage( AttributeTargets.Property )]
    public class HueAttribute : Attribute
    {
        public HueAttribute() { }
    }

    [AttributeUsage( AttributeTargets.Property )]
    public class BodyAttribute : Attribute
    {
        public BodyAttribute() { }
    }

    [AttributeUsage( AttributeTargets.Class | AttributeTargets.Struct )]
    public class PropertyObjectAttribute : Attribute
    {
        public PropertyObjectAttribute() { }
    }

    [AttributeUsage( AttributeTargets.Class | AttributeTargets.Struct )]
    public class NoSortAttribute : Attribute
    {
        public NoSortAttribute() { }
    }




    [AttributeUsage( AttributeTargets.Class | AttributeTargets.Struct )]
    public class ParsableAttribute : Attribute
    {
        public ParsableAttribute() { }
    }

    [AttributeUsage( AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum )]
    public class CustomEnumAttribute : Attribute
    {
        private string[] m_Names;

        public string[] Names
        {
            get { return m_Names; }
        }

        public CustomEnumAttribute( string[] names )
        {
            m_Names = names;
        }
    }

    [AttributeUsage( AttributeTargets.Constructor )]
    public class ConstructableAttribute : Attribute
    {
        public ConstructableAttribute()
        {
        }
    }

    [AttributeUsage( AttributeTargets.Property )]
    public class CommandPropertyAttribute : Attribute
    {
        private AccessLevel m_ReadLevel, m_WriteLevel;

        public AccessLevel ReadLevel
        {
            get { return m_ReadLevel; }
        }

        public AccessLevel WriteLevel
        {
            get { return m_WriteLevel; }
        }

        public CommandPropertyAttribute( AccessLevel level )
            : this( level, level )
        {
        }

        public CommandPropertyAttribute( AccessLevel readLevel, AccessLevel writeLevel )
        {
            m_ReadLevel = readLevel;
            m_WriteLevel = writeLevel;
        }
    }
    #endregion
}
#endregion

